<template>
  <router-view />
</template>

<script setup>
import { useStore } from "vuex";
import { generateNewStyle, writeNewStyle } from "@/utils/theme";
import { watchSwitchLang } from "@/utils/i18n";
const store = useStore();
// 保存写入主题色
generateNewStyle(store.getters.mainColor).then((newStyleText) => {
  writeNewStyle(newStyleText);
});
watchSwitchLang(() => {
  if (store.getters.token) {
    store.dispatch("user/getUserInfo");
  }
});
</script>

<style></style>
